package com.code.web.AZPlan;

import com.code.AZPlan.model.bo.*;
import com.code.AZPlan.model.po.*;
import com.code.commons.annotations.LoginAuth;
import com.code.commons.web.annotations.*;
import com.code.model.vo.az.AzAssetVO;
import com.code.model.vo.az.FastNewsResponseVo;
import com.code.model.vo.az.WalletAssetVO;
import com.code.model.vo.user.UserRecommenderVO;
import com.code.service.AZPlanStaticIncomeService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * AZ计划静态收益控制层
 *
 * @author tangyifei
 * @since 2019年12月31日15:54:18
 */
@ResponseResult
@RestController("AZPlanStaticIncomeController")
@RequestMapping("/AZPlanStaticIncomes")
public class AZPlanStaticIncomeController {

    @Resource
    private AZPlanStaticIncomeService azPlanStaticIncomeService;

    @ApiOperation(value = "刷新内存树", notes = "刷新内存树", httpMethod = "GET")
    @GetMapping("/reload-account-tree")
    // @ProdLimit
    @LoginAuth
//    @SuperAdmin
    public void reloadAccountTree() {
        azPlanStaticIncomeService.reloadAccountTree();
    }

    @ApiOperation(value = "首页(返回某一个用户的矿池大小)", notes = "首页(返回某一个用户的矿池大小)", httpMethod = "GET")
    @GetMapping("/get-ore-pool")
    @LoginAuth
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户主键", dataType = "String", paramType = "query", required = true),
            @ApiImplicitParam(name = "coinType", value = "币种类型", dataType = "String", defaultValue = "XWC", paramType = "query", required = true)
    })
    @RateLimit(key = "limitGetOrePool")
    public Map<String, Object> getOrePool(@RequestParam("userId") String userId, @RequestParam("coinType") String coinType) {
        return azPlanStaticIncomeService.getOrePool(userId, coinType);
    }

    @ApiOperation(value = "跳转到资金划转页面(点击首页的划转调用的API)", response = MoneyTransferBO.class, notes = "跳转到资金划转页面(点击首页的划转调用的API)", httpMethod = "GET")
    @GetMapping("/skip-money-transfer")
    @LoginAuth
    @SystemProtect
    @RateLimit(key = "limitSkipMoneyTransfer")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户主键", dataType = "String", paramType = "query", required = true),
            @ApiImplicitParam(name = "coinType", value = "币种类型", dataType = "String", defaultValue = "XWC", paramType = "query", required = true),
            @ApiImplicitParam(name = "transferType", value = "1表示从钱包划转到AZ计划   2表示从AZ计划划转到钱包", dataType = "int", paramType = "query", required = true),
            @ApiImplicitParam(name = "coinBalanceVersion", value = "币种余额版本号", dataType = "int", paramType = "query", required = true),
    })
    public MoneyTransferBO skipMoneyTransfer(@RequestParam("userId") String userId, @RequestParam("coinType") String coinType,
                                             @RequestParam("transferType") Integer transferType,
                                             @RequestParam("coinBalanceVersion") Integer coinBalanceVersion) throws Exception {
        return azPlanStaticIncomeService.skipMoneyTransfer(userId, coinType, transferType, coinBalanceVersion);
    }

    @ApiOperation(value = "跳转到资产页面(点击首页的资产调用的API)", response = AzAssetVO.class, notes = "跳转到资产页面(点击首页的资产调用的API)", httpMethod = "GET")
    @GetMapping("/skip-asset")
    @LoginAuth
    @SystemProtect
    @RateLimit(key = "limitSkipAsset")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户主键", dataType = "String", paramType = "query", required = true)
    })
    public Map<String, Object> skipAsset(@RequestParam("userId") String userId) {
        return azPlanStaticIncomeService.skipAsset(userId);
    }

    @ApiOperation(value = "资金划转(点击确定划转按钮调用的API)", response = MoneyTransferRecord.class, notes = "资金划转(点击确定划转按钮调用的API)", httpMethod = "POST")
    @PostMapping("/money-transfer")
    @LoginAuth
    @SystemProtect
    @RateLimit(key = "limitMoneyTransfer")
    public MoneyTransferRecord moneyTransfer(@Validated @RequestBody MoneyTransferRecord moneyTransferRecord) {
        return azPlanStaticIncomeService.moneyTransfer(moneyTransferRecord);
    }

    @ApiOperation(value = "入金（点击入金弹窗的完成按钮调用的API）", response = EntryMoneyBO.class, notes = "入金（点击入金弹窗的完成按钮调用的API）", httpMethod = "POST")
    @PostMapping("/entry-money")
    @LoginAuth
    @SystemProtect
    @RateLimit(key = "limitEntryMoney")
    public EntryMoneyBO entryMoney(@Validated @RequestBody EntryMoneyBO entryMoneyBO) throws Exception {
        return azPlanStaticIncomeService.entryMoney(entryMoneyBO);
    }

    @ApiOperation(value = "兑换（点击兑换弹窗的完成按钮调用的API）", response = ExchangeFlow.class, notes = "兑换（点击兑换弹窗的完成按钮调用的API）", httpMethod = "POST")
    @PostMapping("/exchange")
    @LoginAuth
    @SystemProtect
    @RateLimit(key = "limitExchange")
    public ExchangeFlow exchange(@Validated @RequestBody ExchangeFlow exchangeFlow) {
        return azPlanStaticIncomeService.exchange(exchangeFlow);
    }

    @ApiOperation(value = "查看用户的账户明细（用户的各种收益）", response = IncomeFlow.class, notes = "查看用户的账户明细（用户的各种收益）", httpMethod = "GET")
    @GetMapping("/{userId}/incomes")
    @LoginAuth
    @SystemProtect
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户主键", dataType = "String", paramType = "path", required = true),
            @ApiImplicitParam(name = "page", value = "当前页", dataType = "int", paramType = "query", required = true),
            @ApiImplicitParam(name = "pageSize", value = "每页的大小", dataType = "int", paramType = "query", required = true)
    })
    @RateLimit(key = "limitGetIncomes")
    public Map<String, Object> getIncomes(@PathVariable("userId") String userId, @RequestParam(value = "page", required = true) Integer page,
                                          @RequestParam(value = "pageSize", required = true) Integer pageSize) throws Exception {
        return azPlanStaticIncomeService.getIncomes(userId, page, pageSize);
    }

    @ApiOperation(value = "获取USD账单(包括收益和兑换，XWC的转入与转出流水)", response = USDBillBO.class, notes = "获取USD账单(包括收益和兑换)", httpMethod = "GET")
    @GetMapping("/{userId}/usd-bills")
    @LoginAuth
    @SystemProtect
    @RateLimit(key = "limitGetUsdBills")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户主键", dataType = "String", paramType = "path", required = true),
            @ApiImplicitParam(name = "coinType", value = "币种类型", dataType = "String", paramType = "query", required = true),
            @ApiImplicitParam(name = "page", value = "当前页", dataType = "int", paramType = "query", required = false),
            @ApiImplicitParam(name = "pageSize", value = "每页的大小", dataType = "int", paramType = "query", required = false)
    })
    public Map<String, Object> getUsdBills(@PathVariable("userId") String userId, @RequestParam("coinType") String coinType,
                                           @RequestParam(value = "page", required = false) Integer page,
                                           @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        return azPlanStaticIncomeService.getUsdBills(userId, coinType, page, pageSize);
    }

    @ApiOperation(value = "点击钱包按钮进入钱包相关的总资产页面", response = WalletAssetVO.class, notes = "点击钱包按钮进入钱包相关的总资产页面", httpMethod = "GET")
    @GetMapping("/{userId}/wallets/get-wallet-total-assets")
    @LoginAuth
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户主键", dataType = "String", paramType = "path", required = true)
    })
    @RateLimit(key = "limitGetWalletTotalAssets")
    public Map<String, Object> getWalletTotalAssets(@PathVariable("userId") String userId) {
        return azPlanStaticIncomeService.getWalletTotalAssets(userId);
    }

    @ApiOperation(value = "获取相关钱包中的币种账单", response = WalletBillBO.class, notes = "获取相关钱包中的币种账单", httpMethod = "GET")
    @GetMapping("/{userId}/wallets/get-bills")
    @LoginAuth
    @RateLimit(key = "limitGetWalletBills")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户主键", dataType = "String", paramType = "path", required = true),
            @ApiImplicitParam(name = "coinType", value = "币种类型", dataType = "String", paramType = "query", required = true),
            @ApiImplicitParam(name = "coinAddress", value = "币种地址", dataType = "String", paramType = "query", required = false)
    })
    public List<WalletBillBO> getWalletBills(@PathVariable("userId") String userId, @RequestParam("coinType") String coinType,
                                             @RequestParam(value = "coinAddress", required = false) String coinAddress,
                                             @RequestParam(value = "page", required = false) Integer page,
                                             @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        return azPlanStaticIncomeService.getWalletBills(userId, coinType, coinAddress, page, pageSize);
    }

    @ApiOperation(value = "跳转到提币页面", response = WithdrawBO.class, notes = "跳转到提币页面", httpMethod = "GET")
    @GetMapping("/{userId}/wallets/skip-withdraw")
    @LoginAuth
    @Deprecated
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "用户主键", dataType = "String", paramType = "path", required = true),
            @ApiImplicitParam(name = "coinType", value = "币种类型", dataType = "String", paramType = "query", required = true),
            @ApiImplicitParam(name = "toAddress", value = "提币地址", dataType = "String", paramType = "query", required = false)
    })
    public WithdrawBO skipWithdraw(@PathVariable("userId") String userId, @RequestParam("coinType") String coinType,
                                   @RequestParam(value = "toAddress", required = false) String toAddress) {
        return azPlanStaticIncomeService.skipWithdraw(userId, coinType, toAddress);
    }

    @ApiOperation(value = "点击提币按钮进行提币", response = WithdrawOrder.class, notes = "点击提币按钮进行提币", httpMethod = "POST")
    @PostMapping("/{userId}/wallets/withdraw")
    @LoginAuth
    @RateLimit(key = "limitWithdraw")
    public void withdraw(@Validated @RequestBody WithdrawOrder withdrawOrder) {
        azPlanStaticIncomeService.withdraw(withdrawOrder);
    }

    @ApiOperation(value = "进行站内转账", response = InSiteUserBO.class, notes = "进行站内转账", httpMethod = "POST")
    @PostMapping("/in-site-transfer")
    @LoginAuth
    @RateLimit(key = "limitInSiteTransfer")
    public int inSiteTransfer(@RequestBody InSiteUserBO inSiteUserBO) {
        return azPlanStaticIncomeService.inSiteTransfer(inSiteUserBO);
    }

    @ApiOperation(value = "通过站内手机号获取转入方信息（包括转入方的钱包版本号）", response = InSiteUserBO.class, notes = "通过站内手机号获取转入方信息（包括转入方的钱包版本号）", httpMethod = "GET")
    @GetMapping("/{userPhone}/get-in-site-user-info")
    @LoginAuth
    @RateLimit(key = "getInSiteUserInfo")
    public InSiteUserBO getInSiteUserInfo(@PathVariable("userPhone") String userPhone) {
        return azPlanStaticIncomeService.getInSiteUserInfo(userPhone);
    }

    @ApiOperation(value = "审核提币订单", response = WithdrawOrder.class, notes = "审核提币订单", httpMethod = "POST")
    @PostMapping("/wallets/check-withdraw")
    @LoginAuth
//    @SuperAdmin
    @RateLimit(key = "limitCheckWithdraw")
    public int checkWithdraw(@RequestBody WithdrawOrder withdrawOrder) {
        return azPlanStaticIncomeService.checkWithdraw(withdrawOrder);
    }

    @ApiOperation(value = "获取提币订单列表", response = WithdrawBO.class, notes = "获取提币订单列表", httpMethod = "POST")
    @PostMapping("/wallets/get-withdraw-list")
    @LoginAuth
    @RateLimit(key = "limitGetWithdrawList")
    public WithdrawBO getWithdrawList(@RequestBody WithdrawBO withdrawBO) {
        return azPlanStaticIncomeService.getWithdrawList(withdrawBO);
    }

    @ApiOperation(value = "获取所有的提币和入金流水列表", response = WalletAllBillBO.class, notes = "获取所有的提币和入金流水列表", httpMethod = "GET")
    @GetMapping("/wallets/get-all-bills")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "coinType", value = "币种类型", dataType = "String", paramType = "query", required = false)
    })
    @LoginAuth
    @RateLimit(key = "limitGetWalletAllBills")
    public List<WalletAllBillBO> getWalletAllBills(@RequestParam(value = "coinType", required = false) String coinType) {
        return azPlanStaticIncomeService.getWalletAllBills(coinType);
    }

    @ApiOperation(value = "获取快讯列表", response = String.class, notes = "获取快讯列表", httpMethod = "GET")
    @GetMapping(value = "/get-fast-news", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @LoginAuth
    @RateLimit(key = "limitGetFastNews")
    public FastNewsResponseVo getFastNews() {
        return azPlanStaticIncomeService.getFastNews();
    }

    @ApiOperation(value = "手动执行定时任务", response = String.class, notes = "手动执行定时任务", httpMethod = "GET")
    @GetMapping(value = "/manual-exec-schedule", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
//    @ProdLimit
    @LoginAuth
    @SuperAdmin
    @RateLimit(key = "limitManualExecSchedule")
    public void manualExecSchedule() {
        azPlanStaticIncomeService.manualExecSchedule();
    }

    @ApiOperation(value = "手动打印内存树", response = String.class, notes = "手动打印内存树", httpMethod = "GET")
    @GetMapping(value = "/manual-print-memory-tree")
//    @ProdLimit
    @LoginAuth
//    @SuperAdmin
    @RateLimit(key = "limitManualPrintMemoryTree")
    public String manualPrintMemoryTree(@RequestParam(value = "userPhone", required = false) String userPhone) {
        return azPlanStaticIncomeService.manualPrintMemoryTree(userPhone);
    }

    @ApiOperation(value = "获取对应父账户下面的所有子账户累计入金金额", response = EntryMoneyBO.class, notes = "获取对应父账户下面的所有子账户累计入金金额", httpMethod = "GET")
    @GetMapping("/get-all-child-account-total-entry-amount")
//    @ProdLimit
    @LoginAuth
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userPhone", value = "父账户的用户手机号", dataType = "String", paramType = "query", required = false)
    })
    @RateLimit(key = "limitGetAllChildAccountTotalEntryAmount")
    public BigDecimal getAllChildAccountTotalEntryAmount(@RequestParam(value = "userPhone", required = false) String userPhone) {
        return azPlanStaticIncomeService.getAllChildAccountTotalEntryAmount(userPhone);
    }

    @ApiOperation(value = "获取推荐人的所有的间接推荐用户列表（不包含直接推荐用户）", response = UserRecommenderVO.class, notes = "获取推荐人的所有的推荐用户列表（不包含直接推荐用户）", httpMethod = "GET")
    @GetMapping("/{userId}/indirect-children-recommenders")
    @LoginAuth
    @ApiImplicitParams({
            @ApiImplicitParam(name = "userId", value = "推荐人的用户主键", dataType = "String", paramType = "path", required = true),
            @ApiImplicitParam(name = "entryMoneyState", value = "有无入金", dataType = "int", paramType = "query", required = false),
            @ApiImplicitParam(name = "page", value = "当前页", dataType = "int", paramType = "query", required = false),
            @ApiImplicitParam(name = "pageSize", value = "每页的大小", dataType = "int", paramType = "query", required = false),
    })
    @RateLimit(key = "limitGetRecommendsByUserId")
    public Map<String, Object> getIndirectRecommendsByUserId(@PathVariable("userId") String userId,
                                                             @RequestParam(value = "entryMoneyState", required = false) Integer entryMoneyState,
                                                             @RequestParam(value = "page", required = false) Integer page,
                                                             @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        return azPlanStaticIncomeService.getIndirectRecommendsByUserId(userId, entryMoneyState, page, pageSize);
    }

    @ApiOperation(value = "获取推荐人的所有的间接推荐用户列表（不包含直接推荐用户）", response = UserRecommenderVO.class, notes = "获取推荐人的所有的推荐用户列表（不包含直接推荐用户）", httpMethod = "GET")
    @GetMapping("/{phone}/indirect-recommenders-by-phone")
    @LoginAuth
    @ApiImplicitParams({
            @ApiImplicitParam(name = "phone", value = "推荐人的手机号", dataType = "String", paramType = "path", required = true),
            @ApiImplicitParam(name = "entryMoneyState", value = "有无入金", dataType = "int", paramType = "query", required = false),
            @ApiImplicitParam(name = "page", value = "当前页", dataType = "int", paramType = "query", required = false),
            @ApiImplicitParam(name = "pageSize", value = "每页的大小", dataType = "int", paramType = "query", required = false),
    })
    @RateLimit(key = "limitGetRecommendsByUserId")
    public Map<String, Object> getIndirectRecommendsByPhone(@PathVariable("phone") String phone,
                                                            @RequestParam(value = "entryMoneyState", required = false) Integer entryMoneyState,
                                                            @RequestParam(value = "page", required = false) Integer page,
                                                            @RequestParam(value = "pageSize", required = false) Integer pageSize) {
        return azPlanStaticIncomeService.getIndirectRecommendsByPhone(phone, entryMoneyState, page, pageSize);
    }

    @ApiOperation(value = "获取充值列表", response = RechargeTranBO.class, notes = "获取充值列表", httpMethod = "POST")
    @PostMapping("/wallets/get-deposit-list")
    @LoginAuth
    @RateLimit(key = "limitGetDepositList")
    public RechargeTranBO getDepositList(@RequestBody RechargeTranBO rechargeTranBO) {
        return azPlanStaticIncomeService.getDepositList(rechargeTranBO);
    }

    @ApiOperation(value = "下载充值excel表单", notes = "下载充值excel表单", httpMethod = "GET")
    @GetMapping("/export-deposit-excel")
    @LoginAuth
//    @SuperAdmin
    @ExcelExport
    public void exportDepositExcel(HttpServletResponse response) throws Exception {
        azPlanStaticIncomeService.exportDepositExcel(response);
    }

    @ApiOperation(value = "下载提币excel表单", notes = "下载提币excel表单", httpMethod = "GET")
    @GetMapping("/export-withdraw-excel")
    @LoginAuth
//    @SuperAdmin
    @ExcelExport
    public void exportWithdrawExcel(HttpServletResponse response) throws Exception {
        azPlanStaticIncomeService.exportWithdrawExcel(response);
    }

    @ApiOperation(value = "下载用户资产excel表单", notes = "下载用户资产excel表单", httpMethod = "GET")
    @GetMapping("/export-user-assert-excel")
    @LoginAuth
//    @SuperAdmin
    @ExcelExport
    public void exportUserAssertExcel(HttpServletResponse response) throws Exception {
        azPlanStaticIncomeService.exportUserAssertExcel(response);
    }

    @ApiOperation(value = "下载入金流水excel表单", notes = "下载入金流水excel表单", httpMethod = "GET")
    @GetMapping("/export-entry-money-excel")
    @LoginAuth
//    @SuperAdmin
    @ExcelExport
    public void exportEntryMoneyExcel(HttpServletResponse response) throws Exception {
        azPlanStaticIncomeService.exportEntryMoneyExcel(response);
    }

    @ApiOperation(value = "下载兑换流水excel表单", notes = "下载兑换流水excel表单", httpMethod = "GET")
    @GetMapping("/export-exchange-excel")
    @LoginAuth
//    @SuperAdmin
    @ExcelExport
    public void exportExchangeExcel(HttpServletResponse response) throws Exception {
        azPlanStaticIncomeService.exportExchangeExcel(response);
    }

    @ApiOperation(value = "下载收益日报统计excel表单", notes = "下载收益日报统计excel表单", httpMethod = "GET")
    @GetMapping("/export-income-statistics-excel")
    @LoginAuth
    @ExcelExport
    public void exportIncomeStatisticsExcel(HttpServletResponse response) throws Exception {
        azPlanStaticIncomeService.exportIncomeStatisticsExcel(response);
    }

    @ApiOperation(value = "下载收益明细excel表单", notes = "下载收益明细excel表单", httpMethod = "GET")
    @GetMapping("/export-income-detail-excel")
    @LoginAuth
    @ExcelExport
    public void exportIncomeDetailExcel(HttpServletResponse response) throws Exception {
        azPlanStaticIncomeService.exportIncomeDetailExcel(response);
    }

    /**
     * 获取用户资产列表
     *
     * @param userAssetBO 用户资产业务对象
     * @return 用户资产列表
     */
    @ApiOperation(value = "获取用户资产列表", response = UserAssetBO.class, notes = "获取用户资产列表", httpMethod = "POST")
    @PostMapping("/wallets/get-user-assets")
    @LoginAuth
    @RateLimit(key = "limitGetUserAssetList")
    public UserAssetBO getUserAssetList(@RequestBody UserAssetBO userAssetBO) {
        return azPlanStaticIncomeService.getUserAssetList(userAssetBO);
    }

    /**
     * 更新用户账户为内部账户
     *
     * @param phone 用户手机号
     * @return 成功
     */
    @ApiOperation(value = "标记为内部账户", notes = "标记为内部账户", httpMethod = "PATCH")
    @PatchMapping("{phone}/mark-inner-user")
    @LoginAuth
    @RateLimit(key = "limitMarkInnerUser")
    public void markInnerUser(@PathVariable String phone) {
        azPlanStaticIncomeService.markInnerUser(phone);
    }

    /**
     * 获取入金列表
     *
     * @param entryMoneyFlowBO 用户入金流水业务对象
     * @return 用户入金列表
     */
    @ApiOperation(value = "获取入金列表", response = EntryMoneyFlowBO.class, notes = "获取入金列表", httpMethod = "POST")
    @PostMapping("/wallets/get-entry-money-list")
    @LoginAuth
    @RateLimit(key = "limitGetEntryMoneyFlowList")
    public EntryMoneyFlowBO getEntryMoneyFlowList(@RequestBody EntryMoneyFlowBO entryMoneyFlowBO) {
        return azPlanStaticIncomeService.getEntryMoneyFlowList(entryMoneyFlowBO);
    }

    /**
     * 获取兑换流水列表
     *
     * @param exchangeFlowBO 用户兑换流水业务对象
     * @return 用户兑换列表
     */
    @ApiOperation(value = "获取兑换流水列表", response = EntryMoneyFlowBO.class, notes = "获取兑换流水列表", httpMethod = "POST")
    @PostMapping("/wallets/get-exchange-list")
    @LoginAuth
    @RateLimit(key = "limitGetExchangeFlowList")
    public ExchangeFlowBO getExchangeFlowList(@RequestBody ExchangeFlowBO exchangeFlowBO) {
        return azPlanStaticIncomeService.getExchangeFlowList(exchangeFlowBO);
    }

    /**
     * 获取收益统计日报列表
     *
     * @param incomeStatisticsDailyBO 收益统计日报业务对象
     * @return 收益统计日报列表
     */
    @ApiOperation(value = "获取收益统计日报列表", response = IncomeStatisticsDailyBO.class, notes = "获取收益统计日报列表", httpMethod = "POST")
    @PostMapping("/wallets/get-income-statistics-list")
    @LoginAuth
    @RateLimit(key = "limitGetIncomeStatisticsList")
    public IncomeStatisticsDailyBO getIncomeStatisticsList(@RequestBody IncomeStatisticsDailyBO incomeStatisticsDailyBO) {
        return azPlanStaticIncomeService.getIncomeStatisticsList(incomeStatisticsDailyBO);
    }

    /**
     * 获取收益明细列表
     *
     * @param incomeStatisticsDailyBO 收益统计日报业务对象
     * @return 收益明细列表
     */
    @ApiOperation(value = "获取收益明细列表", response = IncomeStatisticsDailyBO.class, notes = "获取收益明细列表", httpMethod = "POST")
    @PostMapping("/wallets/get-income-detail-list")
    @LoginAuth
    @RateLimit(key = "limitGetIncomeDetailList")
    public IncomeStatisticsDailyBO getIncomeDetailList(@RequestBody IncomeStatisticsDailyBO incomeStatisticsDailyBO) {
        return azPlanStaticIncomeService.getIncomeDetailList(incomeStatisticsDailyBO);
    }

    /**
     * 添加公告
     *
     * @param azNotice 公告对象
     * @return 影响的行数
     */
    @ApiOperation(value = "添加公告", notes = "添加公告", httpMethod = "POST")
    @PostMapping("/notices")
    @LoginAuth
    @RateLimit(key = "limitAddAzNotices")
    public int addAzNotice(@RequestBody AzNotice azNotice) {
        return azPlanStaticIncomeService.addAzNotice(azNotice);
    }

    /**
     * 修改公告
     *
     * @param azNotice 公告对象
     * @return 影响的行数
     */
    @ApiOperation(value = "修改公告", notes = "修改公告", httpMethod = "PATCH")
    @PatchMapping("/notices")
    @LoginAuth
    @RateLimit(key = "limitUpdateAzNotice")
    public int updateAzNotice(@RequestBody AzNotice azNotice) {
        return azPlanStaticIncomeService.updateAzNotice(azNotice);
    }

    /**
     * 根据公告主键查询单个公告
     *
     * @param id 主键
     * @return 公告对象
     */
    @ApiOperation(value = "根据公告主键查询单个公告", response = AzNotice.class, notes = "根据公告主键查询单个公告", httpMethod = "GET")
    @GetMapping("/notices/{id}")
    @LoginAuth
    @RateLimit(key = "limitGetAzNoticeById")
    public AzNotice getAzNoticeById(@PathVariable("id") String id) {
        return azPlanStaticIncomeService.getAzNoticeById(id);
    }

    /**
     * 根据相关的检索条件获取公告列表
     *
     * @param azNoticeBO 公告业务对象
     * @return 公告业务对象
     */
    @ApiOperation(value = "根据相关的检索条件获取公告列表", response = AzNoticeBO.class, notes = "根据相关的检索条件获取公告列表", httpMethod = "POST")
    @PostMapping("/notices/get-notice-list")
    @LoginAuth
    @RateLimit(key = "limitGetAzNoticeList")
    public AzNoticeBO getAzNoticeList(@RequestBody AzNoticeBO azNoticeBO) {
        return azPlanStaticIncomeService.getAzNoticeList(azNoticeBO);
    }

    /**
     * 修改公告的上线与下线状态
     *
     * @param azNotice 公告对象
     * @return 影响的行数
     */
    @ApiOperation(value = "修改公告的上线与下线状态", notes = "修改公告的上线与下线状态", httpMethod = "PATCH")
    @LoginAuth
    @RateLimit(key = "limitUpDownAzNotice")
    @PatchMapping("/notices/up-down")
    public int upDownAzNotice(@RequestBody AzNotice azNotice) {
        return azPlanStaticIncomeService.upDownAzNotice(azNotice);
    }
}
